Do not follow redirects when uploading#94
Merged
sigmavirus24 merged 1 commit intomasterfrom Apr 16, 2015
Merged
Conversation
Member
Author
|
I think I'll also probably make this less of a pain so that users don't have to upgrade requests. I can probably make a helper function to do this for us. |
Contributor
There was a problem hiding this comment.
Why check here if allow_redirects is already false?
Contributor
There was a problem hiding this comment.
Nevermind, I figured it out.
PyPI will never redirect a user during an upload. If a redirect is found, either the index URL is incorrect or there could be a malicious redirect at play. requests has well defined behaviour around handling POSTing data and what happens during a redirect. We shouldn't have to think too hard about that and there's probably a problem the user needs to handle if there is a redirect. Requests added 'is_redirect()' to Response objects in 2.3.0. In order to rely on that, we need to bump our minimum version. Closes #92
sigmavirus24
added a commit
that referenced
this pull request
Apr 16, 2015
Do not follow redirects when uploading
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PyPI will never redirect a user during an upload. If a redirect is
found, either the index URL is incorrect or there could be a malicious
redirect at play. requests has well defined behaviour around handling
POSTing data and what happens during a redirect. We shouldn't have to
think too hard about that and there's probably a problem the user needs
to handle if there is a redirect.
Requests added 'is_redirect()' to Response objects in 2.3.0. In order to
rely on that, we need to bump our minimum version.
Closes #92